﻿using LoadClient.YUAN.E;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LoadClient.YUAN.B
{
    public class LanguageManager
    {

        public static List<Language> GetLanguageList()
        {
            return FreeSqlDB.fsql00.Queryable<Language>().ToList();
        }

        public static Language GetLanguageCHToEN(string instr)
        {
            Language laa = FreeSqlDB.fsql00.Select<Language>().Where(la => la.SimplifiedChinese == instr).ToOne();
            return laa == null ? new Language { EnglishUS = instr } : laa;
        }

        public static Language GetLanguageENToCH(string instr)
        {
            Language laa = FreeSqlDB.fsql00.Select<Language>().Where(la => la.EnglishUS == instr).ToOne();
            return laa == null ? new Language { SimplifiedChinese = instr } : laa;
        }

    }
}
